<template>
  <div class="forum">
    <!-- 热门游戏推荐 -->
    <div class="hot">
      <div class="hot-l">热门游戏推荐</div>
      <div class="hot-r">更多</div>
    </div>
    <!-- ul图片 -->
    <div class="aaa">
      <div class="ft-ul">
        <ul>
          <li>
            <img src="../../../../public/images/组5.png" alt="" />
            <div class="div-main">
              <span>明日方舟</span>
              <span>157万+关注</span>
              <span>&nbsp; · &nbsp; </span>
              <span>1271新帖</span>
            </div>
            <div class="btn">
              <p class="btn-img">关注</p>
            </div>
          </li>
          <li v-for="item in Data" :key="item">
            <img :src="item.url" alt="" />
            <div class="div-main">
              <span>{{ item.title }}</span>
              <span>{{ item.attention }}</span>
              <span>&nbsp; · &nbsp; </span>
              <span>{{ item.newpost }}</span>
            </div>
            <div class="btn">
              <p class="btn-img">关注</p>
            </div>
          </li>
        </ul>
        <div class="footer1" style="height: 60px"></div>
      </div>
    </div>
  </div>
</template>
<script>
import { getRecommendApi } from "../../../utils/app";
export default {
  setup() {},
  data() {
    return {
      Data: [],
    };
  },
  mounted() {
    this.getAttention2Apiasync();
  },
  methods: {
    async getAttention2Apiasync() {
      const res = await getRecommendApi();
      if (res.status === 200) {
        this.Data = res.data.list;
      }
    },
  },
};
</script>

<style lang="less">
.forum {
  background: white;
  .hot {
    padding: 6px 15px;
    display: flex;
    justify-content: space-between;
    // border: 1px solid pink;
    .hot-l {
      font-size: 17px;
      font-weight: bold;
      color: #333333;
    }
    .hot-r {
      font-size: 14px;
      font-weight: bold;
      color: #34c3c6;
      margin-right: 12px;
    }
  }
  // 渲染的ul
  .ft-ul {
    ul {
      li {
        margin-bottom: 15px;
        position: relative;
      }

      li {
        display: flex;
        position: relative;
        padding: 8px 14px;
      }
      li:nth-child(1) {
        position: relative;
        img {
          margin-left: -14px;
          display: block;
          width: 400px;
          height: 184px;
          border-radius: 10px;
        }
      }
      li:nth-of-type(1) div {
        span {
          position: absolute;
        }
        span:nth-of-type(1) {
          font-size: 15px;
          font-weight: bold;
          color: #ffffff;
          top: 148px;
          left: 30px;
        }
        span:nth-child(2) {
          font-size: 10px;
          font-weight: bold;
          color: #ffffff;
          margin-right: 15px;
          top: 170px;
          left: 30px;
        }
        span:nth-child(3) {
          font-size: 15px;
          // font-weight: bold;
          color: #ffffff;
          top: 167px;
          left: 84px;
        }
        span:nth-child(4) {
          font-size: 10px;
          font-weight: bold;
          color: #ffffff;
          top: 170px;
          left: 100px;
        }
        .li-img-2 {
          position: absolute;
          display: block;
          width: 75px;
          height: 30px;
          bottom: 10px;
          right: -175px;
        }
      }
      li img {
        display: block;
        width: 50px;
        height: 50px;
        margin-right: 15px;
      }
      li div {
        span:nth-child(1) {
          font-size: 15px;
          font-weight: bold;
          color: #333333;
          position: absolute;
          top: 10px;
          left: 84px;
        }
        span:nth-child(2) {
          font-size: 10px;
          font-weight: bold;
          color: #999;
          // margin-left: 15px;
          // line-height: 50px;
          position: absolute;
          top: 40px;
          left: 85px;
        }
        span:nth-child(3) {
          font-size: 15px;
          // font-weight: bold;
          color: #999;
          position: absolute;
          top: 40px;
          left: 150px;
        }
        span:nth-child(4) {
          font-size: 10px;
          font-weight: bold;
          color: #999;
          position: absolute;
          top: 40px;
          left: 170px;
        }
        .li-img-4 {
          display: block;
          width: 75px;
          height: 30px;
          position: absolute;
          bottom: 10px;
          right: 29px;
        }
      }
    }
  }
  // 点击的关注

  .btn {
    position: absolute;
    // top: 15px;
    bottom: 15px;
    right: 30px;
    // display: inline-block;
    width: 75px;
    height: 30px;
    color: #34c3c6;
    border-radius: 15px;
    background: #e6f8f8;
    box-sizing: border-box;
    text-align: center;
    .btn-img {
      display: block;
      font-size: 16px;
      // font-weight: 600;
      margin: 0;
      line-height: 30px;
    }
  }
}
</style>
